//
//  ViewController.swift
//  ALCore
//
//  Created by Allen on 12/18/2023.
//  Copyright (c) 2023 Allen. All rights reserved.
//

import UIKit
import ALCore_Swift


extension ALPrefixWrapper where Base:FileManager {
    public static var aamanager: FileManager { FileManager.default }
}

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        
        testAL()
        
        // Do any additional setup after loading the view, typically from a nib.
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()

        // Dispose of any resources that can be recreated.
    }

    @objc func ttttt() {

    }

    func testAL() {
        let aa = ALView()
        aa.setImage(UIImage(named: "esign"))
        aa.setTitle("AAAA")
        aa.backgroundColor = UIColor.lightGray
        aa.imagePlacement = .bottom
        view.addSubview(aa)
        aa.snp.makeConstraints { make in
            make.center.equalToSuperview()
        }
        aa.addTapGesture { _ in
            UIAlertController.show(message: "aaa",isVibrate: true,sure: "确定")
        }

        

//        CGFloat.onePixel
//        UIScreen.statusBarHeight
//        CGFloat.statusBarSize

//        ALLog("-------------\(Bundle.al.displayName ?? "") \(Bundle.al.version ?? "")")

//        print("-------------\(Bundle.AppInfoPlist)")
    }

//    func aaa() -> Void {
//        if UserDefaults.XTQMUDKey.isFirstOpen {
//
//        }
//
//        UIScreen.statusBarHeight
//    }

}


extension UserDefaults {
    enum XTQMUDKey:String,ALUserDefaultsGetAndSave {

        case isLogined = "isLogin"

        var key: String {
            get {
                return rawValue
            }
        }

        var userDefaults: UserDefaults {
            get {
               return UserDefaults.standard
            }
        }

        static var isFirstOpen: Bool {
            get {
                return XTQMUDKey.isLogined.bool()
            }
            set {
                XTQMUDKey.isLogined.save(newValue)
            }
        }
    }
}
